package com.demo.hc.common.util;

import java.text.Format;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Created by 1 on 2017/4/27.
 */
public class DateUtils {

    /**
     * datetime -> String
     * @return
     */
    public static String getDateTimeStr(Date date){
        String dateStr = "";
        if(date != null){
            Format format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
            dateStr = format.format(date);
        }
        return dateStr;
    }
}
